package UML;

class Building {
    // 可以添加一些建筑相关的属性和方法
}

class Course {
    // 可以添加一些课程相关的属性和方法

    //该课程一定在某个建筑中进行。
}

public class College {
    private Building[] buildings;
    private Course[] courses;

    public College() {
        // 初始化学院时可以设置一些默认的建筑和课程，或者留待后续添加
        buildings = new Building[0];
        courses = new Course[0];
    }

    // 添加建筑的方法
    public void addBuilding(Building building) {
        Building[] newBuildings = new Building[buildings.length + 1];
        System.arraycopy(buildings, 0, newBuildings, 0, buildings.length);
        newBuildings[buildings.length] = building;
        buildings = newBuildings;
    }

    // 添加课程的方法
    public void addCourse(Course course) {
        Course[] newCourses = new Course[courses.length + 1];
        System.arraycopy(courses, 0, newCourses, 0, courses.length);
        newCourses[courses.length] = course;
        courses = newCourses;
    }
}